import numpy as np
a=np.array(
    [[1,2,3],
     [4,5,6]]
)

from sklearn.preprocessing import Binarizer
#threshold:分割点
bn=Binarizer(threshold=4.5)
a_new=bn.fit_transform(a)
print(a)
print(a_new)